
<?php
    $mysql_hostname = "localhost";
    $mysql_user = "root";
    $mysql_password = "123";
    $mysql_database = "transportation";
	$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password)
    or die("Opps some thing went wrong");

     mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");
	
	date_default_timezone_set('UTC');
    $date = date('Y-m-d h:i:s a', time()); 
    $nowdate=date('Y-m-d',strtotime("+5 days"));
	//echo "$nowdate";
  $query="SELECT jobno FROM formvalues WHERE last_date='$nowdate'";
 // echo "$query";
 
  $run = mysql_query($query);
  $foundnum = mysql_num_rows($run);
  if ($foundnum==0)
{
echo "Sorry, there are no matching result";
}
 else
{
  "INSERT INTO ozekimessageout(msg)
SELECT  formvalues.jobno FROM formvalues
WHERE last_date='$nowdate'";
//echo "$foundnum results found !<p>";

while($runrows = mysql_fetch_assoc($run))

{ 
include 'copydataand insert.php';

}

}       
?>
